package com.qf.dao.impl;


import com.qf.dao.LixiDao;
import com.qf.model.Lixi;
import com.qf.utils.DruidUtils;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanHandler;

import java.sql.SQLException;

public class LixiDaoImpl implements LixiDao {

    private QueryRunner queryRunner = new QueryRunner(DruidUtils.getDataSource());
    //查询利息
    @Override
    public Lixi findRate(String date) {
      String sql = "select * from lixi where date = ?";
        try {
            Lixi query = queryRunner.query(sql, new BeanHandler<>(Lixi.class), date);
            return query;
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return null;
    }
}
